<include file="public@header" />
<link href="__TMPL__/public/hst/layui/css/layui.css"  rel="stylesheet">
<style>
    .layui-form-label{
        width:60px;
    }
</style>
</head>
<body>
    <blockquote class="layui-elem-quote" style="margin-top: 10px">个人信息</blockquote>

    <form class="layui-form js-ajax-form " action="{:url('register/editInfo')}">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-inline" style="width:70px;" >
                    <input type="text" name="name" lay-verify="required" class="layui-input" value="{$info.name}">
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">年龄</label>
                <div class="layui-input-inline" style="width:40px;" >
                    <input type="text" name="age" id="date" lay-verify="number" placeholder=""  class="layui-input" lay-key="1" value="{$info.age}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" >等级</label>
                <div class="layui-input-inline" style="width:50px;" >
                    <div class="layui-input" style="line-height: 35px;background: #f2f2f2;"  disabled="">{$now_lev.cell}</div>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width:80px">邀请人</label>
                <div class="layui-input-inline" style="width:70px;" >
                    <if condition="$info.pid eq 0">
                        <div class="layui-input" style="line-height: 35px;background: #f2f2f2"  disabled="">无</div>
                        <else/>
                        <div  class="layui-input" style="line-height: 35px;background: #f2f2f2"  >
                            <a href="javascript:parent.openIframeLayer('{:url('register/lookregister',array('id'=>$info['pid']))}','{$info.name}的邀请人',{area: ['30%', '20%']
						});">查看</a></div>
                    </if>

                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">手机</label>
                <div class="layui-input-inline" style="width:110px;" >
                    <input type="text" name="phone" id="phone" lay-verify="number" placeholder=""  class="layui-input" lay-key="1" value="{$info.phone}">
                </div>
            </div>
            <div class="layui-inline">
                <if condition="$info.lev eq 1">
                    <label class="layui-form-label" style="width:90px">入会金额</label>
                    <div class="layui-input-inline" style="width:60px">

                        <input type="text" name="money" class="layui-input" >

                    </div>
                    <else/>
                    <label class="layui-form-label" style="width:90px">入会时间</label>
                    <div class="layui-input-inline">
                        <div class="layui-input" style="line-height: 35px;background: #f2f2f2"  >
                            {$money.create_time|date="Y-m-d H:i:s",###}
                        </div>
                    </div>
                    <label class="layui-form-label" style="width:90px">入会金额</label>
                    <div class="layui-input-inline">
                        <div  class="layui-input" style="line-height: 35px;background: #f2f2f2"  >
                            {$money.money}
                        </div>
                    </div>
                </if>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label" >性别</label>
                <div class="layui-input-inline" >
                    <if condition="$info.sex eq 1">
                        <input type="radio" name="sex" value="1" title="男" checked="checked"><div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><div>男</div></div>
                        <input type="radio" name="sex" value="2" title="女"><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>女</div></div>
                        <else/>
                        <input type="radio" name="sex" value="1" title="男" checked=""><div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><div>男</div></div>
                        <input type="radio" name="sex" value="2" title="女" checked><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>女</div></div>
                    </if>
                </div>
            </div>
            <div class="layui-inline layui-form-text">
                <label class="layui-form-label">地址</label>
                <div class="layui-input-inline">
                    <input type="text" name="address" lay-verify="" class="layui-input"style="width:300px" value="{$info.address}">

                    <input type="hidden" name="id" value="{$info.id}" >
                </div>
            </div>
            <div class="layui-inline layui-form-text">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-inline">
                    <textarea placeholder="请输入内容" name="mark" class="layui-textarea" style="width: 500px;height:20px">{$info.mark}</textarea>
                </div>
                <div class="layui-input-inline">
                    <!--<button  type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>-->
                    <button class="layui-btn js-ajax-submit" lay-submit="" lay-filter="demo1">修改</button>
                    <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
                </div>
            </div>
        </div>

        <div class="layui-form-item">


        </div>



        <!--<div class="layui-form-item">-->
            <!--<div class="layui-input-inline">-->
                <!--<button class="layui-btn" lay-submit="" lay-filter="demo1">修改</button>-->
                <!--&lt;!&ndash;<button type="reset" class="layui-btn layui-btn-primary">重置</button>&ndash;&gt;-->
            <!--</div>-->
        <!--</div>-->
    </form>
    <!--<a href="javascript:parent.openIframeLayer('{:url('register/consumes',array('id'=>$info['id']))}','{$info.name}的个人消费',{});"><blockquote class="layui-elem-quote" style="margin-top: 10px">个人消费:&nbsp&nbsp 合计:<strong style="color:green">{$cons}</strong>元&nbsp&nbsp<if condition="$info.lev neq 1">（不包含会费）</if></blockquote></a>-->
    <!--
    <a href="javascript:void();" onclick="getConsume()">
        <blockquote class="layui-elem-quote" style="margin-top: 10px">个人消费:&nbsp&nbsp 合计:<strong style="color:green">{$cons}</strong>元&nbsp&nbsp<if condition="$info.lev neq 1">（不包含会费）</if></blockquote>
    </a>
    <div id="user_consumes">

    </div>
    <a href="javascript:parent.openIframeLayer('{:url('consumes/index',array('id'=>$info['id']))}','{$info.name}的个人消费',{});"><blockquote class="layui-elem-quote" style="margin-top: 10px">总收益:&nbsp&nbsp 合计:<strong style="color:green">{$info.all_money}</strong>元&nbsp&nbsp</blockquote></a>

    <a href="javascript:parent.openIframeLayer('{:url('register/xiaji',array('id'=>$info['id']))}','{$info.name}的个人消费',{});"><blockquote class="layui-elem-quote" style="margin-top: 10px">查看下线</blockquote></a>
    -->
    <div class="layui-collapse">
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">个人消费:&nbsp&nbsp 合计:<strong style="color:green">{$cons}</strong>元&nbsp&nbsp<if condition="$info.lev neq 1">（不包含会费）</if></h2>
            <div class="layui-colla-content" id="user_consumes"></div>
        </div>
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">总收益:&nbsp&nbsp 合计:<strong style="color:green">{$info.all_money}</strong>元&nbsp&nbsp</h2>
            <div class="layui-colla-content" id="total_consumes"></div>
        </div>
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">剩余总积分:&nbsp&nbsp 合计:<strong style="color:green">{$totalIntegral}</strong>分&nbsp&nbsp</h2>
            <div class="layui-colla-content" id="user_integral"></div>
        </div>
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">查看下线</h2>
            <div class="layui-colla-content" id="xiaji"></div>
        </div>
    </div>

    <script src="__STATIC__/js/admin.js"></script>
	<script src="__TMPL__/public/hst/layui/layui.js"></script>
	<script src="__TMPL__/public/hst/layui/lay/modules/table.js"></script>
</body>
<script>
    function getConsume(year){
        var url = "{:url('register/consumes')}";
        var id = "{$info['id']}";
        $.ajax({
            url:url,
            type:"GET",
            data:{id:id,year:year},
            success:function(data){
                $("#user_consumes").html(data);
            }
        });
    }

    function getIntegral(){
        var url = "{:url('register/lookIntegral')}";
        var id = "{$info['id']}";
        $.ajax({
            url:url,
            type:"GET",
            data:{id:id},
            success:function(data){
                $("#user_integral").html(data);
            }
        });
    }

    function getSubUsers(){
        var url = "{:url('register/xiaji')}";
        var id = "{$info['id']}";
        $.ajax({
            url:url,
            type:"GET",
            data:{id:id},
            success:function(data){
                $("#xiaji").html(data);
            }
        });
    }

    function getTotalConsume(year){
        var url = "{:url('consumes/index')}";
        var id = "{$info['id']}";
        $.ajax({
            url:url,
            type:"GET",
            data:{id:id,year:year},
            success:function(data){
                $("#total_consumes").html(data);
            }
        });
    }

</script>

<script>
    //注意：折叠面板 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function(){
        //var element = layui.element;
        getConsume("{$year}");
        getSubUsers();
        getTotalConsume("{$year}");
        getIntegral();
    });


</script>
</html>